home *** CD-ROM | disk | FTP | other *** search
-
- ~4Dgifts/toolbox/src/exampleCode/X/xshowcmap2 README
-
-
- This extension to xshowcmap and this winfo script, can be very helpful
- in debugging problems that occur when dealing with multiple colormaps
- and/or visuals.
-
- xshowcmap2 has been modified with three new optional arguments:
-
- -visid allows specifying the visual id.
- -cmap allows specifying the colormap id.
- -windowid allows specifying a window id. The visual and
- colormap IDs are obtained from the window.
-
- -visid and -cmap are often used together. Neither of these should
- be used with -windowid, which is an alternate way of providing the
- same information.
-
- Note xshowcmap2 is not particularly robust when given invalid values
- for these arguments, and usually will exit with a cryptic X error.
-
- The window ID's, visual ID's, and colormap ID's, can be obtained
- using xwininfo and xprop. Alternatively, the enclosed script,
- winfo, can be used to obtain the same information. Winfo, first
- does an xprop on a selected window (which can be obtained either by
- clicking on the window or with the -id argment). It looks for the
- WM_COLORMAP_WINDOWS property on that window. If it finds that
- property, it does an xwininfo on each window listed. If it does not
- find it, it does an xwininfo on the top level window. In either
- case, the output from xwininfo is filtered to only show the
- information pertinant to colormaps and visuals. The returned values
- can then be passed on to xshowcmap2.
-
- As an example using this, consider the toolchest, which in addition
- to the default colormap, also uses a visual in the popup planes for
- its menus. Run the command winfo, and click on the toolchest. You
- will see output something like this:
-
- window 0x2c00039
- colormap windows 0x2c00038 0x2c00039
-
- xwininfo: Window id: 0x2c00038 (has no name)
- Depth: 2
- Visual id: 0x20
- Visual Class: PseudoColor
- Colormap: 0x2c00006 (installed)
-
- xwininfo: Window id: 0x2c00039 "ToolChest"
- Depth: 8
- Visual id: 0x25
- Visual Class: PseudoColor
- Colormap: 0x32 (installed)
-
- The first line gives you the window ID. The second line shows that
- this window has a WM_COLORMAP_WINDOWS property, which includes two
- windows. This is followed by information on each of the windows in
- that property. The first, of depth 2, is the popup visual, and the
- second, of depth 8, is the default visual. To look at the popup
- colormap, you can issue the command:
-
- xshowcmap2 -windowid 0x2c00038
-
- or, alternatively,
-
- xshowcmap2 -visid 0x20 -cmap 0x2c00006
-
- When looking at colormaps, be aware the usual hardware limitations
- on the number of colormaps apply. For example, if you were also
- looking at the colormap of another application that also used the
- popup planes, only one popup colormap could be in place at a given
- time; when one is installed, it kicks the other out.
-
-